/**
 * Copyright (C) 2015-2018 IQIYI
 * All rights reserved.
 *
 * Author     : 王海斌
 * E-mail     : wanghaibin@qiyi.com
 * Version    :
 * Date       : Wed 15 May 2019 03:14:31 PM CST
 * Destription:  求最大公约数
 */
#include <iostream>

using namespace std;

int measure(int x, int y)
{
    int z = y;
    while(x%y!=0) {
        z = x%y;
        x = y;
        y = z;
    }
    return z;
}

void CheckSsdPersent(long long val, int x, int y)
{
    int ori=x;
    int z = y;
    while(x%y!=0) { //求最大公约数z
        z = x%y;
        x = y;
        y = z;
    }
    int devBack = ori/z;
    if(val%(100/z)<(ori/z)) {
        cout << "true = val%(100/z)=" << val%(100/z) << " x/z=" << (ori/z) << " ze=" << z << endl;
    } else {
        cout << "false = val%(100/z)=" << val%(100/z) << " x/z=" << (ori/z) << "ze=" << z << endl;
    }

}

int main(int , char *[])
{
    cout << "28/35 max=" << measure(28,35) << endl;
    cout << "80/100 max=" << measure(80,100) << endl;
    cout << "75/100 max=" << measure(75,100) << endl;
    cout << "0/100 max=" << measure(0,100) << endl;
    cout << "7/100 max=" << measure(7,100) << endl;

    CheckSsdPersent(8, 7, 100);
    CheckSsdPersent(100, 100, 100);
    cout << endl;

    for(int i=0; i<=110; ++i) {
        CheckSsdPersent(i, 0, 100);
    }
    return 0;
}
